home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / f90 / merge.z / merge
Encoding:
Text File  |  1998-10-30  |  2.3 KB  |  70 lines

  1. MERGE(3I)                                              Last changed: 1-6-98
  2.  
  3.  
  4. NNAAMMEE
  5.      MMEERRGGEE - Chooses an alternative value according to the value of a mask
  6.  
  7. SSYYNNOOPPSSIISS
  8.      MMEERRGGEE (([TTSSOOUURRCCEE==]_t_s_o_u_r_c_e,, [FFSSOOUURRCCEE==]_f_s_o_u_r_c_e,, [MMAASSKK==]_m_a_s_k))
  9.  
  10. IIMMPPLLEEMMEENNTTAATTIIOONN
  11.      UNICOS, UNICOS/mk, and IRIX systems
  12.  
  13. SSTTAANNDDAARRDDSS
  14.      Fortran 90
  15.  
  16. DDEESSCCRRIIPPTTIIOONN
  17.      The MMEERRGGEE intrinsic function can be used for array construction.  It
  18.      chooses an alternative value according to the value of _m_a_s_k.  This
  19.      function accepts the following arguments:
  20.  
  21.      _t_s_o_u_r_c_e   May be of any type
  22.  
  23.      _f_s_o_u_r_c_e   Must be of the same type and type parameters as _t_s_o_u_r_c_e
  24.  
  25.      _m_a_s_k      Must be of type logical
  26.  
  27.      MMEERRGGEE is an elemental function.  The name of this intrinsic cannot be
  28.      passed as an argument.
  29.  
  30. RREETTUURRNN VVAALLUUEESS
  31.      The result has the same type and type parameters as _t_s_o_u_r_c_e.  The
  32.      result is _t_s_o_u_r_c_e if _m_a_s_k is true and _f_s_o_u_r_c_e otherwise.
  33.  
  34. EEXXAAMMPPLLEESS
  35.      Example 1:  Assume that _t_s_o_u_r_c_e, _f_s_o_u_r_c_e, and _m_a_s_k are arrays.  Array
  36.      _t_s_o_u_r_c_e is as follows:
  37.  
  38.         | 1 6 5 |
  39.  
  40.         | 2 4 6 |
  41.  
  42.      Array _f_s_o_u_r_c_e is as follows:
  43.  
  44.         | 0 3 2 |
  45.  
  46.         | 7 4 8 |
  47.  
  48.      Array _m_a_s_k is as follows:
  49.  
  50.         | T F T |
  51.  
  52.         | F F T |
  53.  
  54.      Also assume that the letter TT represents the value true and the letter
  55.      FF represents the value false.  The statement MMEERRGGEE(_t_s_o_u_r_c_e, _f_s_o_u_r_c_e,
  56.      _m_a_s_k) generates the following:
  57.  
  58.         | 1 3 5 |
  59.  
  60.         | 7 4 6 |
  61.  
  62.      Example 2:  The value of MMEERRGGEE((11..00,,00,,00,,kk>>00)) is [1.0] for _k = 5.
  63.  
  64.      Example 3:  The value of MMEERRGGEE((11..00,,00,,00,,kk>>00)) is [0.0] for _k = -2.
  65.  
  66. SSEEEE AALLSSOO
  67.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-2138, for the
  68.      printed version of this man page.
  69.  
  70.